Skip to content

[Do Not Merge] Tutorial adding command#18

Open
hengyiqun wants to merge 3 commits into
AY2021S2-CS2103-T16-2:masterfrom
hengyiqun:tutorial-adding-command
Open

[Do Not Merge] Tutorial adding command#18
hengyiqun wants to merge 3 commits into
AY2021S2-CS2103-T16-2:masterfrom
hengyiqun:tutorial-adding-command

Conversation

@hengyiqun
Copy link
Copy Markdown

[Do Not Merge] Add Remark feature as part of tutorial

assertTrue(standardCommand.equals(standardCommand));

// null -> returns false
assertFalse(standardCommand.equals(null));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I detect that this code is problematic. According to the Correctness (CORRECTNESS), EC: Call to equals(null) (EC_NULL_ARG).
This method calls equals(Object), passing a null value as the argument. According to the contract of the equals() method, this call should always return false.

assertTrue(standardCommand.equals(commandWithSameValues));

// same object -> returns true
assertTrue(standardCommand.equals(standardCommand));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I detect that this code is problematic. According to the Correctness (CORRECTNESS), SA: Self comparison of value with itself (SA_LOCAL_SELF_COMPARISON).
This method compares a local variable with itself, and may indicate a typo or a logic error. Make sure that you are comparing the right things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants